<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>更换手机号码</title>
		<link rel="stylesheet" type="text/css" href="__API__/lib/css/swiper.min.css">
		<link rel="stylesheet" type="text/css" href="__API__/lib/css/mui.css?v=1">
		<link rel="stylesheet" type="text/css" href="__API__/lib/css/mobileSelect.css" />
		<link rel="stylesheet" href="__API__/lib/css/style.css">
		<script type="text/javascript" src="__API__/lib/js/jquery-1.11.0.min.js"></script>
		<script type="text/javascript" src="__API__/lib/js/mui.js"></script>
		<script src="__API__/lib/js/mobileSelect.js" type="text/javascript" charset="utf-8"></script>
		<script src="__API__/lib/js/city.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript" src="__API__/lib/js/swiper.min.js"></script>
		<script type="text/javascript" src="__API__/lib/js/vue.min.js"></script>
		<script type="text/javascript" src="__API__/lib/js/common.js"></script>
		<script type="text/javascript" src="__API__/lib/js/index.js"></script>
	<script src="https://cdn.staticfile.org/axios/0.18.0/axios.min.js"></script></head>

	<body>
		<div class="page_box" id="app" style="min-height: 100vh;">
			<div class="bank_cont">
				<div class="bank_box">
					<ul class="bank_list update_list">
						<li>
							<span>姓名</span>
							<input type="text" placeholder="" v-model="username" readonly />
						</li>
						<li>
							<span>新手机号</span>
							<input type="text" placeholder="请输入新手机号码" v-model="phone"  />
						</li>
						<li>
							<span>验证码</span>
							<input type="text" placeholder="请输入验证码" v-model="code" />
							<button class="yzmcode" @click="getCode()" :disabled="disadles">{{massage}}</button>
						</li>
					</ul>
				</div>
				<div class="blue_btn bank_btn" @click="onSubmit()">确认修改</div>
			</div>
		</div>
		<script>
			var app = null;
			app = new Vue({
				el: '#app',
				data: {
					username: '李思思',
					phone: '',
					code: '',
					time: 60,
					disadles: false,
					massage: '获取验证码'
				},
				created: function() {
					var that = this;
				},
				methods: {
					goDetail(url) {
						common.openUrl(url)
					},
					//获取验证码
					getCode() {
						let that = this;
						let setInter = setInterval(() => {
							that.time--;
							if (that.time <= 0) {
								that.massage = "获取验证码";
								that.disadles = false;
								clearInterval(setInter);
							} else {
								that.massage = "重新获取(" + that.time + ")";
								that.disadles = true;
							}
						}, 1000);
					},
					onSubmit() {
						let that = this;
						let data = {
							username: that.username,
							phone: that.phone,
							code: that.code,
						}
						common.ajax('', data, function(res) {
							if (res.success) {
								common.showToast(res.msg);
								setTimeout(function() {
									common.PageBack();
								}, 1000)
							}else{
								common.showToast(res.msg);
							}
						})
					}
				}
			});
		</script>
	</body>

</html>
